package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpIncidentEditCustNameIconPageUtil extends SeleniumPageUtil{
	
	public final static By IECN_SPAN_INCIDENT = By.id("ctl44_lblIncidentID");
	public final static By IECN_INPUT_CUSTOMER = By.id("ctl44_txtNewCustomer");
	public final static By IECN_LI_CUSTOMER = By.xpath("//*[@id='ctl44_aceCustomer_completionListElem']/li");
	
	public final static By IECN_INPUT_REQUESTER = By.id("ctl44_txtRequester");
	public final static By IECN_LI_REQUESTER = By.xpath("//*[@id='ctl44_aceRequester_completionListElem']/li");
	
	public final static By IECN_INPUT_CONTACT = By.id("ctl44_txtPointOfContact");
	public final static By IECN_LI_CONTACT = By.xpath("//*[@id='ctl44_aceContact_completionListElem']/li");
	
	public final static By IECN_INPUT_SERIAL_NUMBER = By.id("ctl44_txtSerialNumber");
	public final static By IECN_LI_SERIAL_NUMBER = By.xpath("//*[@id='ctl44_aceSerialNumber_completionListElem']/table/tbody/tr/td[1]");
	
	public final static By IECN_INPUT_MANUFACTURER = By.id("ctl44_txtAssetmanufacturer");
	public final static By IECN_BUTTON_SAVE = By.id("ctl44_btnSave");
	public final static By IECN_BUTTON_CANCEL = By.id("ctl44_btnCancel");
	
	public static void waitForEditCustNamePageToLoad(){
		SeleniumUtil.waitOnElements(new By[]{
				IECN_SPAN_INCIDENT, IECN_INPUT_CUSTOMER, IECN_INPUT_REQUESTER, IECN_INPUT_CONTACT, IECN_INPUT_SERIAL_NUMBER,
				IECN_INPUT_MANUFACTURER, IECN_BUTTON_SAVE, IECN_BUTTON_CANCEL 
		});
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IECN_SPAN_INCIDENT));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IECN_INPUT_CUSTOMER));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IECN_INPUT_REQUESTER));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IECN_INPUT_CONTACT));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IECN_INPUT_SERIAL_NUMBER));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IECN_INPUT_MANUFACTURER));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IECN_BUTTON_SAVE));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IECN_BUTTON_CANCEL));
	}
}
